#!/bin/bash

app_name="bigdata "
app_home='/opt/app/zkapp/zookeeper'
filter_str='jps'
function print()
{
        echo " │"
        echo " ├$app_name $1 节点"
        echo " └───────────────"
}

function status()
{
	echo ""
	echo "#$app_name 集群状态..."
	ssh bigdata1 $filter_str
	print 1
	ssh bigdata2 $filter_str
	print 2
	ssh bigdata3 $filter_str
	print 3
}
arg="status"
if [ "$arg" = "start" ];then
	start
	status
elif [ "$arg" = "stop" ];then
	stop
	status
elif [ "$arg" = "restart" ];then
	stop
	start
	status
elif [ "$arg" = "status" ];then
	status
else
	echo "请传入start|stop|restart|status参数"
fi
